package com.five.taotao.Adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import java.util.List;

/**
 * gaomengjiao
 * Created by MQ on 2016/11/4.
 */
public class VPFregmentAdapter extends FragmentStatePagerAdapter {
    private List<String> list;
    private  List<Fragment> mData;
    public VPFregmentAdapter(FragmentManager fm) {
        super(fm);
    }
    public VPFregmentAdapter(FragmentManager fm,List<Fragment> mData,List<String> list) {
        super(fm);
        this.mData=mData;
        this.list=list;
    }

    @Override
    public Fragment getItem(int position) {
        return mData.get(position);
    }

    @Override
    public int getCount() {
        return mData.size();
    }

    ////直接用适配器来完成标题的显示，
    @Override
    public  CharSequence getPageTitle(int position){
        return this.list.get(position);
    }
}
